package com.itcast.bulls.stock.pending.service;

import com.itcast.bulls.stock.common.exception.ComponentException;
import com.itcast.bulls.stock.entity.quote.TradeStockQuoteLast;
import com.itcast.bulls.stock.entity.trade.TradeOrder;
import com.itcast.bulls.stock.pending.vo.LimitPlaceOrderRequestVo;
import com.itcast.bulls.stock.struct.grpc.trade.RecallOrderRequest;

/**
 * 挂单服务业务层接口
 */
public interface IStockTradePendingService {

    TradeStockQuoteLast getTradeStockQuoteLast(long stockId) throws ComponentException;

    /**
     * 创建交易订单记录
     * @param requestVo
     * @return
     * @throws ComponentException
     */
    TradeOrder createTradeOrder(LimitPlaceOrderRequestVo requestVo) throws ComponentException;


    boolean checkMatchPrice(Integer direction, Long execPrice, TradeStockQuoteLast quoteLastMsg);

    LimitPlaceOrderRequestVo processMarketOrder(LimitPlaceOrderRequestVo placeOrder, TradeStockQuoteLast quoteLastMsg) throws ComponentException;

    /**
     * 挂单数据撤回的数据接口
     * @param request
     */
    void recallOrder(RecallOrderRequest request) throws ComponentException;
}

